
<template>
  <div class="dialog">
    <el-dialog
      :title="'点检任务模板'+titleText"
      :visible.sync="showDialog"
      width="55%"
      top="0"
      :close-on-click-modal="false"
      @close="cancel"
    >
      <el-form
        ref="ruleForm"
        label-position="left"
        :model="formData"
        :rules="rules"
        class="el-form"
      >
        <el-form-item label="任务名称：" class="w50p" prop="taskName">
          <el-input
            v-model="formData.taskName"
            clearable
            placeholder="请输入任务名称"
          />
        </el-form-item>
        <el-form-item label="任务模板：" class="w50p" prop="planTaskModelId">
          <el-select
            v-model="formData.planTaskModelId"
            clearable
            filterable
            placeholder="任务模板选择"
            @change="selectPlanTaskModel($event)"
          >
            <el-option
              v-for="item of planModelList"
              :key="item.planTaskModelId"
              :label="item.planTaskModelName"
              :value="item.planTaskModelId"
            />
          </el-select>
        </el-form-item>
        <el-form-item label="任务模板归属计划：" class="w50p" prop="planId">
          <el-select
            v-model="formData.planId"
            clearable
            filterable
            placeholder="任务模板归属计划选择"
            @change="selectPlan($event)"
          >
            <el-option
              v-for="item of planList"
              :key="item.planId"
              :label="item.planName"
              :value="item.planId"
            />
          </el-select>
        </el-form-item>

        <el-form-item label="配置时间：" class="w50p" prop="startTime">
          <div>
            <el-date-picker
              v-model="formData.startTime"
              type="datetime"
              placeholder="选择开始时间"
              value-format="yyyy-MM-dd HH:mm:ss"
              clearable
            />
            <el-date-picker
              v-model="formData.endTime"
              type="datetime"
              placeholder="选择结束时间"
              value-format="yyyy-MM-dd HH:mm:ss"
              clearable
            />
          </div>
        </el-form-item>
        <el-form-item label="是否需要审核：" class="w50p" prop="whetherExamine">
          <el-select
            v-model="formData.whetherExamine"
            clearable
            filterable
            placeholder="选择是否需要审核"
          >
            <el-option
              v-for="item of whetherExamineList"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            />
          </el-select>
        </el-form-item>
        <el-form-item v-if="formData.whetherExamine" label="审核时间：" class="w50p">
          <div>
            <el-date-picker
              v-model="formData.reviewStartTime"
              type="datetime"
              placeholder="选择开始时间"
              value-format="yyyy-MM-dd HH:mm:ss"
              format="yyyy-MM-dd HH:mm:ss"
              clearable
            />
            <el-date-picker
              v-model="formData.reviewEndTime"
              type="datetime"
              placeholder="选择结束时间"
              value-format="yyyy-MM-dd HH:mm:ss"
              format="yyyy-MM-dd HH:mm:ss"
              clearable
            />
          </div>
        </el-form-item>
      </el-form>
      <div class="equip-select-box-show-box">
        <div class="equip-select-box-show-title" @click="querShow()">预览全部设备及检查项</div>
      </div>
      <div class="equip-select-box">
        <div class="equip-select-box-left">
          <div class="equip-select-box-left-title">设备列表</div>
          <div class="equip-select-box-left-content">
            <!-- <el-checkbox v-model="checkAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">
              全选
            </el-checkbox>
            <el-checkbox-group v-model="checkedEquipments" @change="handleCheckedChange">
              <el-checkbox v-for="(key) in allEquipmentList" :key="key.equipmentCode" :label="key.equipmentCode">
                <div @click.stop.prevent="selectEquipmentCode(key.equipmentCode)">
                  {{ key.equipmentName }}
                </div>
              </el-checkbox>
            </el-checkbox-group>-->
            <el-tree
              ref="tree"
              :data="allEquipmentList"
              show-checkbox
              node-key="equipmentCode"
              :default-checked-keys="checkedEquipments"
              :props="defaultProps"
              @node-click="queryShowHaveChekcList"
              @check="getHaveEquipmentId"
            />
          </div>
        </div>
        <div class="equip-select-box-right">
          <el-table
            ref="checkTable"
            highlight-current-row
            :data="checkList"
            stripe
            border
            height="100%"
            @selection-change="handleSelectionChange"
          >
            <el-table-column type="selection" width="55" />
            <el-table-column type="index" label="序号" width="50">
              <template
                slot-scope="scoped"
              >{{ scoped.row.equipmentCheckItemMapperId?scoped.$index+1:'' }}</template>
            </el-table-column>
            <el-table-column prop="checkItemName" label="检查项名称" />
            <el-table-column label="标准值">
              <template slot-scope="scoped">
                <div
                  v-if="scoped.row.checkType==='NUMTYPE'"
                >{{ scoped.row.lowerLimit?'下限:'+scoped.row.lowerLimit+scoped.row.unitName:'' }}{{ scoped.row.upperLimit?'上限:'+scoped.row.upperLimit+scoped.row.unitName:'' }}</div>
                <div v-else>{{ scoped.row.standardValue }}</div>
              </template>
            </el-table-column>
            <el-table-column prop="accessMethod" label="检查方式" />
          </el-table>
        </div>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button class="cancelbtn" @click="cancel()">取 消</el-button>
        <el-button type="primary" class="savebtn" @click="save('ruleForm')">发 布</el-button>
      </div>
    </el-dialog>
    <ShowCheckDialog
      ref="ShowCheckDialog"
      :show-check-result="false"
      :show-check-list="showCheckList"
      :show.sync="showCheckDialog"
      @closeDialog="showCheckDialog=false"
      @cancelDialog="showCheckDialog=false"
    />
  </div>
</template>

<script>
import inspectionTaskTemplateApi from "@/api/equip-inspection/inspection-task-template";
import inspectionPlanApi from "@/api/equip-inspection/inspection-plan";
import inspectionDataitemApi from "@/api/equip-inspection/inspection-dataitem";
import ShowCheckDialog from "../../components/show-check-dialog.vue";
import equipScrapRecordApi from "@/api/equip-manage/equip-scrap-record";
import inspectionTaskApi from "@/api/equip-inspection/inspection-task";

export default {
  name: "",
  components: { ShowCheckDialog },
  props: {
    // 弹框名称
    titleText: {
      type: String,
      default: "",
    },
    nowChanceStau: {
      type: String,
      default: "",
    },
    show: {
      type: Boolean,
      default: false,
    },
    editObject: {
      type: [Object],
      default: () => {
        return {};
      },
    },
  },
  data() {
    const validateDate = (rule, value, callback) => {
      if (!this.formData.startTime) {
        callback(new Error("请选择生效起始日期"));
      } else if (!this.formData.endTime) {
        callback(new Error("请选择生效结束日期"));
      } else {
        callback();
      }
    };
    return {
      formData: {},
      rules: {
        taskName: [
          {
            required: true,
            message: "请输入任务名称",
            trigger: ["change", "blur"],
          },
        ],
        planId: [
          {
            required: true,
            message: "请任务模板归属计划",
            trigger: ["change", "blur"],
          },
        ],
        whetherExamine: [
          {
            required: true,
            message: "请选择是否需要审核",
            trigger: ["change", "blur"],
          },
        ],
        generateHour: [
          {
            required: true,
            message: "请选择任务自动生成时间",
            trigger: ["change", "blur"],
          },
        ],
        startTime: [
          {
            required: true,
            validator: validateDate,
            trigger: ["change", "blur"],
          },
        ],
      },
      // 任务模板归属计划
      planList: [],
      whetherExamineList: [
        { name: "是", id: true },
        { name: "否", id: false },
      ],
      // 任务审核时间
      generateHourList: [
        { generateHourId: 0, generateHourName: "00:00:00" },
        { generateHourId: 1, generateHourName: "01:00:00" },
        { generateHourId: 2, generateHourName: "02:00:00" },
        { generateHourId: 3, generateHourName: "03:00:00" },
        { generateHourId: 4, generateHourName: "04:00:00" },
        { generateHourId: 5, generateHourName: "05:00:00" },
        { generateHourId: 6, generateHourName: "06:00:00" },
        { generateHourId: 7, generateHourName: "07:00:00" },
        { generateHourId: 8, generateHourName: "08:00:00" },
        { generateHourId: 9, generateHourName: "09:00:00" },
        { generateHourId: 10, generateHourName: "10:00:00" },
        { generateHourId: 11, generateHourName: "11:00:00" },
        { generateHourId: 12, generateHourName: "12:00:00" },
        { generateHourId: 13, generateHourName: "13:00:00" },
        { generateHourId: 14, generateHourName: "14:00:00" },
        { generateHourId: 15, generateHourName: "15:00:00" },
        { generateHourId: 16, generateHourName: "16:00:00" },
        { generateHourId: 17, generateHourName: "17:00:00" },
        { generateHourId: 18, generateHourName: "18:00:00" },
        { generateHourId: 19, generateHourName: "19:00:00" },
        { generateHourId: 20, generateHourName: "20:00:00" },
        { generateHourId: 21, generateHourName: "21:00:00" },
        { generateHourId: 22, generateHourName: "22:00:00" },
        { generateHourId: 23, generateHourName: "23:00:00" },
      ],
      dayList: [
        { dayName: "1天", dayId: 1 },
        { dayName: "2天", dayId: 2 },
        { dayName: "3天", dayId: 3 },
        { dayName: "4天", dayId: 4 },
        { dayName: "5天", dayId: 5 },
        { dayName: "6天", dayId: 6 },
        { dayName: "7天", dayId: 7 },
        { dayName: "8天", dayId: 8 },
        { dayName: "9天", dayId: 9 },
        { dayName: "10天", dayId: 10 },
        { dayName: "11天", dayId: 11 },
        { dayName: "12天", dayId: 12 },
        { dayName: "13天", dayId: 13 },
        { dayName: "14天", dayId: 14 },
      ],
      showDialog: this.show,
      // 该设备的点检项
      checkList: [],
      // 查询所有设备
      allEquipmentList: [],
      // 全选按钮
      checkAll: false,
      isIndeterminate: true,
      // 已经选中的设备
      checkedEquipments: [],
      showCheckList: [],
      showCheckDialog: false,
      // 当前添加的设备
      equipmentCode: "",
      // 任务模板
      planModelList: [],
      // 已经绑定的模板详情
      getPlanTaskModelList: [],
      // 任务详情
      getTaskInfoList: [],
      defaultProps: {
        label: "equipmentName",
        id: "equipmentCode",
      },
      // 表格数据切换不能刷新勾选框
      noSelectionChange: false,
    };
  },

  watch: {
    show(v) {
      this.showDialog = v;
    },
    nowChanceStau(v) {
      this.checkList = [];
      this.showCheckList = [];
      this.checkedEquipments = [];
      if (v === "check") {
        this.$nextTick(() => {
          this.$refs.tree.setCheckedKeys([]);
        });
        this.formData = this.editObject;
        // 查询已绑定的检查项和设备
        this.queryTaskInfo(this.formData.taskId);
        this.selectPlan(this.formData.planId);
      }
    },
  },
  created() {
    this.queryPlanList();
    this.queryPlanTaskModelList();
    this.queryEquipment();
  },
  mounted() {},
  methods: {
    // 查询任务详情
    queryTaskInfo(item) {
      var params = {
        taskId: item,
      };
      inspectionTaskApi.query(params).then((res) => {
        if (res.code === 1) {
          let data = res.data || [];
          this.getTaskInfoList = data["taskEquipmentMapperList"] || [];
          this.showCheckList = [];
          this.checkedEquipments = [];
          if (this.getTaskInfoList.length > 0) {
            for (var i in this.getTaskInfoList) {
              // 选中该已选设备
              if (
                this.allEquipmentList.findIndex(
                  (d) =>
                    d.equipmentCode === this.getTaskInfoList[i]["equipmentCode"]
                ) !== -1
              ) {
                this.checkedEquipments.push(
                  this.getTaskInfoList[i]["equipmentCode"]
                );
              }
              // 收集已选点检项
              var src = {
                equipmentCode: this.getTaskInfoList[i]["equipmentCode"],
                equipmentName: this.changeEquipmentNameById(
                  this.getTaskInfoList[i]["equipmentCode"]
                ),
              };
              src["taskCheckItemMapperList"] = [];
              if (
                this.getTaskInfoList[i]["taskCheckItemMapperList"].length > 0
              ) {
                for (var k in this.getTaskInfoList[i][
                  "taskCheckItemMapperList"
                ]) {
                  src["taskCheckItemMapperList"].push(
                    this.getTaskInfoList[i]["taskCheckItemMapperList"][k]
                  );
                }
              }
              this.showCheckList.push(src);
            }
          }
        }
      });
    },
    //  查询已绑定的检查项和设备
    queryPlanTaskModel(item) {
      var params = {
        planTaskModelId: item,
      };
      inspectionTaskTemplateApi.query(params).then((res) => {
        if (res.code === 1) {
          let data = res.data || [];
          this.getPlanTaskModelList = data["planTaskEquipmentMapperList"] || [];
          this.showCheckList = [];
          this.checkedEquipments = [];
          if (this.getPlanTaskModelList.length > 0) {
            for (var i in this.getPlanTaskModelList) {
              // 选中该已选设备
              if (
                this.allEquipmentList.findIndex(
                  (d) =>
                    d.equipmentCode ===
                    this.getPlanTaskModelList[i]["equipmentCode"]
                ) !== -1
              ) {
                this.checkedEquipments.push(
                  this.getPlanTaskModelList[i]["equipmentCode"]
                );
              }
              // 收集已选点检项
              var src = {
                equipmentCode: this.getPlanTaskModelList[i]["equipmentCode"],
                equipmentName: this.changeEquipmentNameById(
                  this.getPlanTaskModelList[i]["equipmentCode"]
                ),
              };
              src["taskCheckItemMapperList"] = [];
              if (
                this.getPlanTaskModelList[i]["planTaskCheckItemMapperList"]
                  .length > 0
              ) {
                for (var k in this.getPlanTaskModelList[i][
                  "planTaskCheckItemMapperList"
                ]) {
                  src["taskCheckItemMapperList"].push({
                    equipmentCheckItemMapperId:
                      this.getPlanTaskModelList[i][
                        "planTaskCheckItemMapperList"
                      ][k]["equipmentCheckItemMapperId"],
                  });
                }
              }
              this.showCheckList.push(src);
            }
          }
        }
      });
    },
    // // 全选
    // handleCheckAllChange(val) {
    //   var checkedEquipments = []
    //   this.allEquipmentList.forEach(a => {
    //     checkedEquipments.push(a.equipmentCode)
    //   })
    //   this.checkedEquipments = val ? checkedEquipments : [];
    //   this.isIndeterminate = false;
    //   if (val) {
    //     this.handleShowCheckList('all')
    //   } else {
    //     this.showCheckList = []
    //     this.checkList = []
    //     this.checkedIdList = []
    //   }
    // },
    // 获取当前被选中节点的 key，使用此方法必须设置 node-key 属性,checkbox
    getHaveEquipmentId(data) {
      var checkedEquipments = this.$refs.tree.getCheckedNodes();
      this.checkedEquipments = [];
      this.checkedEquipments = checkedEquipments.map(
        (item) => item.equipmentCode
      );
      this.equipmentCode = data.equipmentCode;
      this.queryCheckList(data.equipmentCode);
    },
    // 获取该设备的点检项（包含被选中的）
    queryShowHaveChekcList(data) {
      this.equipmentCode = data.equipmentCode;
      this.queryHaveCheckList(data.equipmentCode);
    },
    // 查询该设备下的点检项
    async queryHaveCheckList(equipmentCode) {
      this.checkList = [];
      this.noSelectionChange = true;
      var key = this.allEquipmentList.findIndex(
        (a) => a.equipmentCode === equipmentCode
      );
      if (key !== -1) {
        if (
          this.allEquipmentList[key]["checkList"] &&
          this.allEquipmentList[key]["checkList"].length > 0
        ) {
          this.checkList = this.allEquipmentList[key]["checkList"];
        } else {
          await inspectionDataitemApi
            .queryByEquipmentCode({ equipmentCode: equipmentCode })
            .then((res) => {
              if (res.code === 1) {
                var data = res.data || [];
                this.checkList = data;
                this.allEquipmentList[key]["checkList"] = this.checkList;
              }
            });
        }
        this.noSelectionChange = false;
        if (this.checkList.length > 0) {
          // var index1 = this.allEquipmentList.findIndex(a => a.equipmentCode === equipmentCode)
          // if (index1 !== -1) {
          //   this.allEquipmentList[index1]['checkList'] = this.checkList
          // }
          var index = this.showCheckList.findIndex(
            (a) => a.equipmentCode === equipmentCode
          );
          if (index !== -1) {
            var list = [];
            this.checkList.forEach((a) => {
              if (
                this.showCheckList[index].taskCheckItemMapperList.findIndex(
                  (b) =>
                    b.equipmentCheckItemMapperId ===
                    a.equipmentCheckItemMapperId
                ) !== -1
              ) {
                list.push(a);
              }
            });
            this.toggleSelection(list);
          }
        }
      }
    },
    // 查询该设备下的点检项,默认都打勾
    async queryCheckList(equipmentCode) {
      var key = this.allEquipmentList.findIndex(
        (a) => a.equipmentCode === equipmentCode
      );
      if (key !== -1) {
        if (
          this.allEquipmentList[key]["checkList"] &&
          this.allEquipmentList[key]["checkList"].length > 0
        ) {
          this.checkList = this.allEquipmentList[key]["checkList"];
        } else {
          await inspectionDataitemApi
            .queryByEquipmentCode({ equipmentCode: equipmentCode })
            .then((res) => {
              if (res.code === 1) {
                var data = res.data || [];
                this.checkList = data;
                this.allEquipmentList[key]["checkList"] = this.checkList;
              }
            });
        }
        // 全部设备的全部检查项都要添加
        if (
          this.checkedEquipments.findIndex((k) => k === this.equipmentCode) !==
          -1
        ) {
          if (this.checkList.length > 0) {
            this.toggleSelection(this.checkList);
          }
        } else {
          this.toggleNoSelection(this.checkList);
        }
      }
    },
    // 默认全选不选
    toggleNoSelection(rows) {
      if (rows) {
        this.$nextTick(() => {
          rows.forEach((row) => {
            this.$refs.checkTable.toggleRowSelection(row, false);
          });
        });
      } else {
        this.$refs.checkTable.clearSelection();
      }
    },
    // 默认全选
    toggleSelection(rows) {
      if (rows) {
        this.$nextTick(() => {
          rows.forEach((row) => {
            this.$refs.checkTable.toggleRowSelection(row, true);
          });
        });
      } else {
        this.$refs.checkTable.clearSelection();
      }
    },
    // 单个是否勾选该设备下的点检项
    handleSelectionChange(list) {
      this.checkedIdList = [];
      this.checkedIdList = list.map((item) => item.equipmentCheckItemMapperId);
      if (!this.noSelectionChange) {
        this.handleShowCheckList();
      }
    },
    changeEquipmentNameById(v) {
      var index = this.allEquipmentList.findIndex(
        (item) => item.equipmentCode === v
      );
      if (index !== -1) {
        return this.allEquipmentList[index]["equipmentName"];
      }
    },
    // 添加预览表
    handleShowCheckList() {
      var list = [];
      // // 把当前的设备下的点检项点都删了之后重新加
      if (this.showCheckList.length > 0) {
        this.showCheckList.forEach((k) => {
          if (k.equipmentCode && k.equipmentCode !== this.equipmentCode) {
            list.push(k);
          }
        });
      }
      var showCheckList = list;
      if (
        this.checkedEquipments.findIndex((k) => k === this.equipmentCode) !== -1
      ) {
        let partCheckList = [];
        this.checkList.forEach((a) => {
          if (
            this.checkedIdList.findIndex(
              (k) => k === a.equipmentCheckItemMapperId
            ) !== -1
          ) {
            partCheckList.push(a);
          }
        });
        if (partCheckList.length > 0) {
          showCheckList.push({
            equipmentCode: this.equipmentCode,
            equipmentName: this.changeEquipmentNameById(this.equipmentCode),
            taskCheckItemMapperList: partCheckList,
          });
        }
      }
      this.showCheckList = [];
      this.showCheckList = showCheckList;
    },
    // 显示预览表
    querShow() {
      this.showCheckDialog = true;
    },
    // 选择计划自动填充是否审核和生成时间
    selectPlan(data) {
      if (data) {
        inspectionPlanApi.query({ planId: data }).then((res) => {
          if (res.code === 1) {
            let data = res.data || [];
            this.$set(this.formData, "whetherExamine", data["whetherExamine"]);
            this.$set(this.formData, "generateHour", data["generateHour"]);
          } else {
            this.$message.error(res.msg);
          }
        });
      }
    },
    // 任务模板选择
    selectPlanTaskModel(item) {
      var index = this.planModelList.findIndex(
        (a) => a.planTaskModelId === item
      );
      if (index !== -1) {
        var data = this.planModelList[index];
        this.checkList = [];
        this.showCheckList = [];
        this.checkedEquipments = [];
        this.queryPlanTaskModel(data["planTaskModelId"]);
        this.$set(this.formData, "startTime", data.startTime);
        this.$set(this.formData, "endTime", data.endTime);
        this.$set(this.formData, "planId", data.planId);
        this.selectPlan(data.planId);
      }
    },
    // 任务模板
    queryPlanTaskModelList() {
      inspectionTaskTemplateApi.queryList({}).then((res) => {
        if (res.code === 1) {
          let data = res.data || {};
          this.planModelList = data || [];
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // 查询未报废的设备
    queryEquipment() {
      this.allEquipmentList = [];
      let params = {};
      equipScrapRecordApi.queryEquipment(params).then((res) => {
        if (res.code === 1) {
          let data = res.data || [];
          for (var i in data) {
            this.allEquipmentList.push({
              equipmentName: data[i],
              equipmentCode: i,
            });
          }
        }
      });
    },
    // 任务模板归属计划
    queryPlanList() {
      inspectionPlanApi.queryList({}).then((res) => {
        if (res.code === 1) {
          let data = res.data || {};
          this.planList = data || [];
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    save(formData) {
      this.$refs[formData].validate((valid) => {
        if (valid) {
          if (this.nowChanceStau === "check") {
            var form = this.formData;
            var params = {
              taskName: form["taskName"],
              planId: form["planId"],
            };
            params["endTime"] = form["endTime"];
            params["startTime"] = form["startTime"];
            params["taskEquipmentMapperList"] = this.showCheckList;
            params.taskId = this.editObject.taskId;
            params.taskCode = this.editObject.taskCode;
            inspectionTaskApi.edit(params).then((res) => {
              if (res.code === 1) {
                this.examine(this.editObject["taskId"]);
              } else {
                this.$message.error(res.msg);
              }
            });
          }
        } else {
          return false;
        }
      });
    },
    examine(item) {
      var params = {
        taskId: item,
      };
      inspectionTaskApi.examine(params).then((res) => {
        if (res.code === 1) {
          this.$message.success(res.msg);
          this.close();
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    close() {
      this.$emit("closeDialog");
    },
    cancel() {
      this.$emit("cancelDialog");
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep
  .el-dialog__wrapper
  .el-dialog
  .el-dialog__body
  .el-form
  .el-form-item
  .el-form-item__label {
  min-width: 160px;
}
.equip-select-box {
  display: flex;
  width: 100%;
  min-height: 300px;
  .equip-select-box-left {
    min-width: 160px;
    flex: 1;
    background-color: #c0dbe1;
    padding: 10px;
    margin-right: 10px;
    color: #000;
    .equip-select-box-left-title {
      padding: 0 0 10px 0;
      font-size: 17px;
      text-align: center;
      border-bottom: 1px dashed #e2e2e2;
    }
    .equip-select-box-left-content {
      padding: 10px 0 0;
      max-height: 300px;
      overflow-y: auto;
      overflow-x: hidden;
    }
  }
  .equip-select-box-right {
    flex: 3;
  }
}
::v-deep .el-checkbox {
  padding: 0 0 5px 0;
  color: #fff;
}
::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
  color: #fff;
}
::v-deep .el-table th {
  color: #000;
  background-color: rgba(120, 182, 193, 0.4) !important;
}
::v-deep .el-table .el-table__row--striped {
  color: #000;
  background-color: rgba(186, 186, 186, 0.4) !important;
}
::v-deep.el-table td,
.el-table th.is-leaf,
.el-table--border,
.el-table--group,
.el-table th.is-leaf {
  border-color: #d3d3d3 !important;
}
::v-deep .el-table th.is-leaf {
  border-color: #d3d3d3 !important;
}
::v-deep .el-table__empty-text {
  color: #000;
}
::v-deep .el-table {
  color: #000;
  position: relative !important;
}
.equip-select-box-show-box {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.equip-select-box-show-title {
  color: #000;
  margin: 10px;
  cursor: pointer;
  font-size: 17px;
  position: relative;
  width: fit-content;
  white-space: nowrap;
  &:after {
    content: "";
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 999;
    background-color: #006e91;
  }
  &:hover {
    color: #006e91;
  }
}
::v-deep .el-tree-node {
  white-space: nowrap;
  outline: 0;
  background-color: #c0dbe1;
  border: #c0dbe1 1px solid;
  margin-top: 0 !important;
}
::v-deep .el-tree-node .el-tree-node__content {
  background-color: #c0dbe1 !important;
}
::v-deep .el-tree-node__label {
  background-color: #c0dbe1 !important;
  color: #000 !important;
}
</style>
